<template>
  <div class="faqs-home">
    <div class="header"><span @click="comeBack" class="goBack">
      <van-icon name="arrow-left"/></span>
      商家入驻
    </div>
    <div class="safe"/>
    <div class="faqs-header">
      <div class="faqs-logo">
        <img class="logo" src="@/assets/image/logo.c794a1a1.svg" alt="">
        <span class="down-load">
              <el-popover
                  placement="bottom"
                  trigger="click">
                  <div class="country">
                    <div class="item">
                       <img src="@/assets/image/zh.png" alt="">
                        <span>Chinese</span>
                    </div>
                  </div>
                  <img slot="reference" src="@/assets/image/zh.png" alt="">
              </el-popover>
            </span>
      </div>
      <div class="faqs-text">
        SM-wholesale shop 商家入驻
        <p>
          我们的合作伙伴计划为您提供全方位的营销支持和服务，我们的客户服务团队将提供专业的支持和建议，帮助您优化您的产品展示和销售策略。</p>
        <p> 现在就加入我们吧！让我们一起创造更大的商业机会，共同成长！ </p>
      </div>
    </div>
    <div class="shop-info">
      <div class="shop-join-in">
        <div class="title">商业信息</div>
        <div class="title-login"> 如果您已是卖家，请 <a href="javascript:void (0)">点击登录</a></div>
        <div class="form">
          <el-form size="middle" :model="ruleForm" :rules="rules" label-width="375" ref="ruleForm"
                   class="demo-ruleForm">
            <el-form-item prop="name">
              <template slot="label">
                <span class="box-title">店铺标志</span>
              </template>
              <div class="box-input">
                <input type="text">
                <el-upload
                    class="upload-demo"
                    action="https://jsonplaceholder.typicode.com/posts/"
                    multiple
                    :limit="1"
                >
                  <div class="input">
                    <i class="el-icon-camera-solid"></i>
                  </div>
                </el-upload>
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px" prop="name">
              <template slot="label">
                <span class="box-title">店铺名称</span>
              </template>
              <div class="box-input">
                <el-input placeholder="请输入店铺名称"></el-input>
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px" required prop="name">
              <template slot="label">
                <span class="box-title">国家</span>
              </template>
              <div class="box-input">
                <input type="text">
                <el-select style="width: 100%;" v-model="value" placeholder="请选择国家">
                  <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value">
                  </el-option>
                </el-select>
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px" prop="name">
              <template slot="label">
                <span class="box-title">证件/护照号码</span>
              </template>
              <div class="box-input">
                <el-input placeholder="请输入店铺名称"></el-input>
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px" prop="name">
              <template slot="label">
                <span class="box-title">真实姓名</span>
              </template>
              <div class="box-input">
                <el-input placeholder="请输入店铺名称"></el-input>
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px" prop="name">
              <template slot="label">
                <span class="box-title">whatsAPP</span>
              </template>
              <div class="box-input">
                <el-input placeholder="请输入账号" v-model="inputs" class="input-with-select">
                  <div slot="prepend" @click="chekckCountry">
                    <span>+44</span>
                    <van-icon name="arrow-down"/>
                  </div>
                </el-input>
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px" prop="name">
              <template slot="label">
                <span class="box-title">证件照/上传护照</span>
              </template>
              <div class="box-input" style="display: flex;justify-content: space-around">

                <el-upload
                    class="upload-demo"
                    action="https://jsonplaceholder.typicode.com/posts/"
                    multiple
                    :limit="1"

                >
                  <div class="input">
                    <i class="el-icon-camera-solid"></i>
                  </div>
                  <p class="upload-text">证件正面</p>
                </el-upload>
                <el-upload
                    class="upload-demo"
                    action="https://jsonplaceholder.typicode.com/posts/"
                    multiple
                    :limit="1"
                >
                  <div class="input">
                    <i class="el-icon-camera-solid"></i>
                  </div>
                  <p class="upload-text">证件反面</p>
                </el-upload>
                <el-upload
                    class="upload-demo"
                    action="https://jsonplaceholder.typicode.com/posts/"
                    multiple
                    :limit="1"
                >
                  <div class="input">
                    <i class="el-icon-camera-solid"></i>
                  </div>
                  <p class="upload-text">手持证件照</p>
                </el-upload>
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px">
              <template slot="label">
                <span class="box-title">证件照/上传护照</span>
              </template>
              <div class="box-input" style="display: flex;justify-content: space-around">
                <img src="@/assets/image/p1.png" alt="">
                <img src="@/assets/image/p2.png" alt="">
                <img src="@/assets/image/p3.png" alt="">
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px" prop="name">
              <template slot="label">
                <span class="box-title">电子邮箱</span>
              </template>
              <div class="box-input">
                <el-input placeholder="请输入电子邮箱"></el-input>
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px" prop="name">
              <template slot="label">
                <span class="box-title">手机号</span>
              </template>
              <div class="box-input">
                <el-input placeholder="请输入手机号" v-model="inputs" class="input-with-select">
                  <div slot="prepend" @click="chekckCountry">
                    <span>+44</span>
                    <van-icon name="arrow-down"/>
                  </div>
                </el-input>
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px" prop="name">
              <template slot="label">
                <span class="box-title">登录密码</span>
              </template>
              <div class="box-input">
                <el-input show-password type="password" placeholder="请输入登录密码"></el-input>
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px" prop="name">
              <template slot="label">
                <span class="box-title">再次输入密码</span>
              </template>
              <div class="box-input">
                <el-input show-password type="password" placeholder="再次输入密码"></el-input>
              </div>
            </el-form-item>
            <el-form-item style="margin-top: -20px" prop="name">
              <template slot="label">
                <span class="box-title">邀请码</span>
              </template>
              <div class="box-input">
                <el-input placeholder="邀请码"></el-input>
              </div>
            </el-form-item>
            <!--            <el-form-item>-->
            <!--              <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>-->
            <!--              <el-button @click="resetForm('ruleForm')">重置</el-button>-->
            <!--            </el-form-item>-->
          </el-form>
        </div>

      </div>
    </div>
    <div class="submit">
      <p>
        <van-checkbox style="margin-right: 10px" icon-size="15px" @change="changeCheckBox" v-model="checked" checked-color="#f89220"/>
        我已经阅读并同意 <a href="javascript:void (0)">入驻协议</a>
      </p>
      <p class="btn"><a href="javascript:void (0)">提交申请表</a></p>
    </div>

    <van-popup closeable round v-model="openCountry" position="bottom" :style="{ height: '80%' }">
      <div class="content-main">
        <div class="title">选择区域码</div>
        <div class="input">
          <div class="input-label">
            <img src="@/assets/image/search-b.png" alt="">
            <input type="text" placeholder="请输入要搜索的国家名称">
          </div>
          <div class="country-list">
            <div class="item">
                <span class="left">
                  <img src="@/assets/image/zh.png" alt="">
                  <span>中国</span>
                </span>
              <span class="right">+86</span>
            </div>
            <div class="item">
                <span class="left">
                  <img src="@/assets/image/zh.png" alt="">
                  <span>中国</span>
                </span>
              <span class="right">+86</span>
            </div>
            <div class="item">
                <span class="left">
                  <img src="@/assets/image/zh.png" alt="">
                  <span>中国</span>
                </span>
              <span class="right">+86</span>
            </div>
            <div class="item">
                <span class="left">
                  <img src="@/assets/image/zh.png" alt="">
                  <span>中国</span>
                </span>
              <span class="right">+86</span>
            </div>
          </div>
        </div>
      </div>
    </van-popup>

    <van-popup v-model="protocolDisplay" round closeable>
      <div class="rotocol-main">
        <div class="information">
          <p class="title">经营合同</p>
          <p class="content">经双方经友好协商，对于商城合作一事达成如下协议：</p>
          <p class="title">合作期间：</p>
          <p class="content">一、甲方责任</p>
          <p class="content">
            1.甲方需提供足够的供应商以及商品，用于合作。<br>
            2.甲方需提供安全及运输工作，以其一切工商税务和运输费用等。 其包括：打包、安装、售后、运输、公共关系，等一切费用<br>
            3.甲方需保证物流运输的正常运行，并负责商品和工作人员的安全。 如出现人为破坏，被盗，物品损坏，均由甲方全面负责，照价赔偿。<br>
          </p>
          <p class="content"> 二、乙方责任</p>
          <p class="content">
            1.乙方需提供商品成本、维护商城买家（客户关系）。<br>
            2.乙方保证良好的个人信用。<br>
            3.乙方需24小时内及时处理订单。<br>
          </p>
          <p class="content">三、违约条款</p>
          <p class="content">
            1.如有特殊情况，经双方协商协议解决。<br>
            2.如受政策影响，特殊情况和经营状态不好。乙方全权负责。<br>
            3.双方必须严格遵守合同规定，如单方违约，任何一方需负法律责任或者赔偿。<br>
            4.即签字之日起效。<br>
          </p>
          <div class="bottom">
            <img src="@/assets/image/aaaaaa.png" alt="">
            <p class="footer">
              甲方：SM-wholesale shop <br><br> 日期：2024-12-01
            </p>
            <p class="footer">
              乙方：<img class="sign" :src="signCanvasVal" alt=""><br><br>日期：2024-12-01
            </p>
          </div>
          <div class="bottom-submit">
            <a href="javascript:void (0)" @click="signName=true">同意并签名</a>
            <a href="javascript:void (0)" @click="protocolDisplay=false">确 定</a>
          </div>
        </div>
        <van-popup v-model="signName" round>
            <div class="sign-main">
              <div class="image">
                <sign-canvas
                    class="sign-canvas"
                    ref="signCanvasRef"
                    :options="optionsSign"
                    v-model="signCanvasVal"
                />
              </div>
              <div class="button">
                <van-button style="height: 40px" @click="handleClear" type="warning">重置</van-button>
                <van-button style="height: 40px" @click="signName=false" type="warning">上一步</van-button>
                <van-button  style="height: 40px" @click="signName=false" type="danger">确定</van-button>
              </div>
            </div>
        </van-popup>

      </div>
    </van-popup>
  </div>
</template>

<script>
export default {
  data() {
    return {
      openCountry: false,
      checked: false,
      protocolDisplay: false,
      signName:false,
      signCanvasVal:'',//签名的返回值
      optionsSign: {
        isDpr: false, //是否使用dpr兼容高倍屏 [Boolean] 可选
        lastWriteSpeed: 1, //书写速度 [Number] 可选
        lastWriteWidth: 2, //下笔的宽度 [Number] 可选
        lineCap: "round", //线条的边缘类型 [butt]平直的边缘 [round]圆形线帽 [square]    正方形线帽
        lineJoin: "bevel", //线条交汇时边角的类型  [bevel]创建斜角 [round]创建圆角 [miter]创建尖角。
        canvasWidth: 390, //canvas宽高 [Number] 可选
        canvasHeight: 160, //高度  [Number] 可选
        isShowBorder: true, //是否显示边框 [可选]
        bgColor: "#fff", //背景色 [String] 可选
        borderWidth: 1, // 网格线宽度  [Number] 可选
        borderColor: "#fff", //网格颜色  [String] 可选
        writeWidth: 5, //基础轨迹宽度  [Number] 可选
        maxWriteWidth: 30, // 写字模式最大线宽  [Number] 可选
        minWriteWidth: 5, // 写字模式最小线宽  [Number] 可选
        writeColor: "#101010", // 轨迹颜色  [String] 可选
        isSign: true, //签名模式 [Boolean] 默认为非签名模式,有线框, 当设置为true的时候没有任何线框
        imgType: "png", //下载的图片格式  [String] 可选为 jpeg  canvas本是透明背景的
      },
      ruleForm: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      options: [{
        value: '0',
        label: '美国'
      }, {
        value: '1',
        label: '法国'
      }, {
        value: '2',
        label: '德国'
      }, {
        value: '3',
        label: '英国'
      }],
      value: '',
      select: '+44',
      inputs: '',
      rules: {
        name: [
          {required: true, message: '请输入活动名称', trigger: 'blur'},
          {min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur'}
        ],
        region: [
          {required: true, message: '请选择活动区域', trigger: 'change'}
        ],
        date1: [
          {type: 'date', required: true, message: '请选择日期', trigger: 'change'}
        ],
        date2: [
          {type: 'date', required: true, message: '请选择时间', trigger: 'change'}
        ],
        type: [
          {type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change'}
        ],
        resource: [
          {required: true, message: '请选择活动资源', trigger: 'change'}
        ],
        desc: [
          {required: true, message: '请填写活动形式', trigger: 'blur'}
        ]
      }
    }
  },
  methods: {
    changeCheckBox(){
      this.protocolDisplay=true
    },
    comeBack() {
      this.$router.push('/mine')
    },
    handleClear() {
      this.$refs.signCanvasRef.canvasClear();
    },
    chekckCountry() {
      this.openCountry = true
    }
  }
}
</script>

<style scoped lang="scss">
.faqs-home {
  width: 100%;
  box-sizing: border-box;

  .header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    background: #fff;
    height: 45px;
    width: 100%;
    text-align: center;
    line-height: 45px;
    margin: 0 auto;
    color: #323233;
    font-weight: 500;
    font-size: 16px;

    .goBack {
      position: absolute;
      left: 10px;
    }
  }

  .safe {
    width: 100%;
    height: 45px;
  }

  .faqs-header {
    width: 100%;
    height: 300px;
    background: url("../../assets/image/faqs-bgk.png") no-repeat 50% 50%;
    background-position: top center;
    padding: 3%;
    box-sizing: border-box;

    .faqs-image {
      position: absolute;
      width: 100%;
      height: 300px;
      z-index: 0;
      top: 0;
      right: 0;
      object-fit: cover;
    }

    .faqs-logo {
      width: 100%;
      height: 40px;
      display: flex;
      justify-content: space-between;
      align-items: center;

      .logo {
        height: 35px;
      }

      .down-load {
        font-size: 12px;
        color: #fff;

        img {
          margin-right: 5px;
          height: 25px;
        }

      }
    }

    .faqs-text {
      margin-top: 50px;
      width: 100%;
      font-size: 14px;
      color: #f89220;

      p {
        margin-top: 10px;
        font-size: 12px;
        color: #a6a6a6;
        width: 60%;
      }
    }
  }

  .shop-info {
    width: 100%;
    padding: 6%;
    box-sizing: border-box;

    .shop-join-in {
      width: 100%;
      min-height: 500px;

      .title {
        font-size: 24px;
        color: #333;
        font-weight: 700;
      }

      .title-login {
        width: 100%;
        font-size: 12px;
        color: #333333;
        margin: 10px 0;

        a {
          color: #f89220;
        }
      }

      .form {
        width: 100%;
      }
    }
  }

  .submit {
    width: 100%;
    height: 100px;
    padding: 20px 0 0 0;
    box-sizing: border-box;
    border-top: 1px solid #f6f6f6;

    p:nth-child(1) {
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      color: #333;
      height: 20px;

      a {
        color: #f89220;
      }
    }

    .btn {
      margin-top: 20px;
      width: 100%;
      display: flex;
      justify-content: center;

      a {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 40px;
        width: 100px;
        background: #f89220;
        color: #fff;
        font-size: 14px;
      }
    }
  }

  .box-title {
    font-size: 12px;
    width: 100%;
  }

  .box-input {
    width: 100%;
    margin-top: 2px;
    padding: 0 50px 0 0;
    box-sizing: border-box;

    img {
      margin-right: 10px;
    }

    .input {
      text-align: center;
      line-height: 70px;
      width: 70px;
      background: #f6f6f6;
      height: 70px;
      font-size: 30px;
      color: #aaa;
    }

    .upload-text {
      font-size: 12px;
      color: #333;
    }

    .box-input-left {
      width: 60px;
      height: 100%;
      font-size: 14px;

      span {
        margin-right: 10px;
      }
    }
  }

  .content-main {
    width: 100%;

    .title {
      width: 100%;
      text-align: center;
      line-height: 50px;
      font-size: 14px;
    }

    .input {
      width: 100%;
      height: 30px;
      padding: 0 10px;
      box-sizing: border-box;

      .input-label {
        width: 100%;
        height: 30px;
        background: #f6f6f6;
        display: flex;
        align-items: center;
        padding: 0 3%;
        box-sizing: border-box;
        font-size: 12px;

        img {
          margin-right: 10px;
          height: 14px;
        }
      }

      .country-list {
        width: 100%;
        padding: 0 3%;
        box-sizing: border-box;
        margin-top: 30px;

        .item {
          width: 100%;
          height: 30px;
          display: flex;
          align-items: center;
          justify-content: space-between;
          margin-bottom: 15px;

          .left {
            color: #333333;
            font-size: 12px;
            display: flex;
            align-items: center;

            img {
              margin-right: 10px;
              height: 18px;
            }
          }

          .right {
            font-size: 14px;
            color: #666;
          }
        }
      }
    }
  }

  .rotocol-main {
    min-height: 200px;
    background: none;
    padding: 3%;
    box-sizing: border-box;
    width: 350px;
    background: #fff;
    font-size: 12px;
    .information{
      width: 100%;
      height: 500px;
      overflow-y: scroll;
      overflow-x: hidden;
      .title{
        margin-top: 20px;
        margin-bottom: 20px;
      }
      .content{
        font-size: 12px;
        margin-top: 10px;
      }
      .bottom{
        width: 100%;
        height: 120px;
        position: relative;
        display: flex;
        margin-bottom: 60px;
        img{
          height: 60px;
          position: absolute;
          left: 40%;
          top: 10px;
        }
        .footer{
          z-index: 999;
          margin: 20px 15px;
          font-size: 12px;
        }
      }

      .bottom-submit{
        width: 345px;
        height: 80px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        bottom: 0;
        z-index: 1000;
        background: #fff;
        overflow: hidden;
        box-sizing: border-box;
        a{
          display: flex;
          justify-content: center;
          align-items: center;
          padding: 10px 18px;
          color: #fff;
          font-size: 14px;
          background: #f89220;
          margin-left: 10px;
          border-radius: 8px;
        }
      }
    }
  .information::-webkit-scrollbar{
    display: none;
   }
  }
}

.sign-main{
  height: 210px;
  width: 350px;
  .image{
    width: 100%;
    height: 150px;
  }
  .button{
    width: 100%;
    height: 70px;
    border-top: 1px solid #f6f6f6;
    display: flex;
    justify-content: space-between;
    padding: 10px 3%;
    box-sizing: border-box;
  }
}

::-webkit-scrollbar{
  width: 0;
}
</style>